package com.sample.action;
/**
 * Bxmessage ation
 * @author 深深
 * @version 1.0
 */
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


import com.sample.action.form.BxmessageForm;

import com.sample.javabean.Bxmessage;
import com.sample.util.Pager;

public class BxmessageAction extends BaseAction{
	/**
	 * 
	 */
	private static final long serialVersionUID = -7782137170199294572L;
	private final static Log log=LogFactory.getLog(BxmessageAction.class);
	private Pager<Bxmessage> pageList;
	private String cardNo;
	private Bxmessage bxmessage=new Bxmessage();
	private BxmessageForm bxmessageForm=new BxmessageForm();
	private int id;
	public Pager<Bxmessage> getPageList() {
		return pageList;
	}
	public void setPageList(Pager<Bxmessage> pageList) {
		this.pageList = pageList;
	}
	public String getCardNo() {
		return cardNo;
	}
	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}
	public Bxmessage getBxmessage() {
		return bxmessage;
	}
	public void setBxmessage(Bxmessage bxmessage) {
		this.bxmessage = bxmessage;
	}
	public BxmessageForm getBxmessageForm() {
		return bxmessageForm;
	}
	public void setBxmessageForm(BxmessageForm bxmessageForm) {
		this.bxmessageForm = bxmessageForm;
	}
	
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String save()throws Exception{
		try{
			
			
			if(bxmessageForm!=null){
				Bxmessage bxmessage =new Bxmessage();
			   
				bxmessage.setCardNo(bxmessageForm.getCardNo());
				bxmessage.setFull_name(bxmessageForm.getFull_name());
				bxmessage.setThetime(bxmessageForm.getThetime());
			   
			   
		
				bxmessage.add();
			}
			return SUCCESS;
		}catch (Exception e) {
			e.printStackTrace();
			
		}
		return "inputBxmessage";
	}
	
	public String list()throws Exception{
		Bxmessage bxmessageModel =new Bxmessage();
		pageList =bxmessageModel.list(page, size, bxmessageForm);
		return "listBxmessage";
	}
	
	public String del() throws Exception {
		try {
			if (bxmessageForm != null) {
				bxmessage.setId(id);
				bxmessage.delBxmessage();
			}
			return SUCCESS;
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
	}
	
	

}
